import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/ruoyi";

// 查询用户列表
export function list (data) {
    return request({
        url: '/manage/experiment/experimentPage',
        method: 'post',
        data: data
    })
}

// 实验建议
export function experimentAdvisePage (query) {
    return request({
        url: '/manage/experiment/experimentAdvisePage',
        method: 'get',
        params: query
    })
}

// 新增
export function addExperiment (data) {
    return request({
        url: '/manage/experiment/add',
        method: 'post',
        data: data
    })
}

// 修改
export function editExperiment (data) {
    return request({
        url: '/manage/experiment/edit',
        method: 'put',
        data: data
    })
}

// 删除
export function deleteById (data) {
    return request({
        url: '/manage/experiment/deleteById/' + data.id,
        method: 'delete',
        data
    })
}

// 根据id克隆实验数据
export function cloneExperiment (id) {
    return request({
        url: '/manage/experiment/cloneExperiment/' + id,
        method: 'get'
    })
}

// 查询学校
export function schoolSelect () {
    return request({
        url: '/manage/school/getList',
        method: 'get'
    })
}

export function deptTreeSelect () {
    return request({
        url: '/system/user/deptTree',
        method: 'get'
    })
}

// 根据实验名称获取实验列表
export function getByExperimentName (params) {
    return request({
        url: '/manage/experiment/getByExperimentName',
        method: 'get',
        params
    })
}

// 根据实验id获取实验设备数据
export function getExperimentDeviceListByExperimentId (id) {
    return request({
        url: '/manage/experimentDevices/getExperimentDeviceListByExperimentId/' + id,
        method: 'get'
    })
}
